<div id='questions_div' class="questions">
    <style type="text/css">
            /* CSS for the scrollers */
        div.horizontal_scroller, div.vertical_scroller {
            position: relative;
            height: 24px;
            width: 500px;
            display: block;
            overflow: hidden;
            border: #CCCCCC 1px solid;
        }

        .submit {
            float: left;
            height: 30px;
            padding-top: 6px;
            text-align: right;
            width: 266px;
        }
    </style>

    <h2>
        <div class="com_tit">问题征集<span>QUESTIONS</span></div>
    </h2>
    <?php if ($question_channel != null) { ?>
    <div class="ask">
        <script type="text/javascript">
            $(document).ready(function() {
                $('.vertical_scroller').SetScroller({    velocity: 40, direction: 'vertical'  });
            })

            var u_id = "<?php echo $sf_user->getAttribute('userId') ?>";


            function post_question() {
                if (null != u_id && "" != u_id && u_id > 0) {
                } else {
                    u_id = "1";
                }
                var content = $("#ask_word").val();
                if (content.trim() == '') {
                    alert("请勿提交空问题！");
                    return;

                }
                $.ajax({
                    type: "POST",
                    url: "<?php echo url_for('question/post') ?>",
                    data: "content=" + content + "&userId=" + u_id + "&qcId=<?php echo $question_channel->getId() ?>",
                    success: questionsResult
                });
            }
            function questionsResult(content) {
                $('#questions_div').html(content);
                alert("问题已提交!");
            }


        </script>
        <h3>
            <?php echo link_to($question_channel->getTitle(), 'question/index?id=' . $question_channel->getId()) ?>

        </h3>

        <div class="ask_box">
            <form action="#" name="questins">
                <div class="ask_img">
                    <img src="<?php echo url_for($question_channel->getImg()) ?>">

                </div>
                <div class="ask_input">
                    <textarea name="ask_word" id='ask_word' class="ask_word"></textarea>
                </div>

                <div class="submit"><input class="ask_submit" value="提交" onclick="post_question()"></div>
            </form>
        </div>
        <h3>粉丝们的提问：</h3>

        <div class="vertical_scroller" style="height: 100px;width: auto;">
            <div class="scrollingtext" style="position: absolute; top: -140px;">
                <!--        <div class="fans_ask">-->
                <!--            <div style="position: absolute; top: -173px;" id="rollText">-->
                <ul>
                    <?php
               foreach ($questions as $question) {
                    //                    if ($question->getContent() == null || trim($question->getContent()) == '') continue;
                    echo "<li>&nbsp" . $question->getUsers()->getNickname() . "： " . link_to($question->getContent(), 'question/index?id=' . $question_channel->getId()) . "</li>";
                }
                    ?>
                </ul>


            </div>
        </div>
        <!--            </div>-->
        <!--        </div>-->

    </div>
    <?php } ?>
</div>
